﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QuantitativeInvestment.View
{
    
     partial class AnalyserForm : Form
    {
        public MainForm mainForm;
        public AnalyserForm(MainForm form)
        {
            InitializeComponent();
            this.mainForm = form;
            List<string> analyzerNameList = CharacterAnalyzer.CharacterAnalyzer.getAnalyzerList();
            foreach (string analyzerName in analyzerNameList)
            {

                this.checkedListBox1.Items.Add(analyzerName);
            }

            this.updateCheckedListView();
        }

        public void updateCheckedListView()
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.mainForm.container.analyserList.Clear();
            for (int i = 0; i < this.checkedListBox1.SelectedItems.Count; i++)
            {
               
               string analyzerName= this.checkedListBox1.SelectedItems[i].ToString();
               CharacterAnalyzer.CharacterAnalyzer analyzer = CharacterAnalyzer.CharacterAnalyzer.createContainerByName(analyzerName);
               analyzer.container = this.mainForm.container;
               this.mainForm.container.analyserList.Add(analyzer);
            }
            this.Dispose();
        }
    }
}
